package ltd.newbee.mall.service.impl;

import ltd.newbee.mall.dao.OrderItemMapper;
import ltd.newbee.mall.dao.OrderMapper;
import ltd.newbee.mall.entity.Proportion;
import ltd.newbee.mall.entity.Sale;
import ltd.newbee.mall.service.SaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.*;

@Service
public class SaleServiceImpl implements SaleService {


    @Autowired
    private OrderMapper orderMapper;

    @Autowired
    private OrderItemMapper orderItemMapper;

    @Override
    public List<Sale> select_Nearly_10_days(Integer day) {

//        List<Sale> sales = orderMapper.selectNearly_10_days();

        return orderMapper.selectNearly_10_days(day);
    }

    @Override
    public List<Sale> select_Month_by_Year(String year) {
        return orderMapper.selectNearly_Month(year);
    }

    @Override
    public List<Proportion> selectRate(Integer rate) {
        return orderItemMapper.selectProject(rate);
    }
}
